[#331] Combine create + chain into tabbed page with Add Plot shortcut#333
[#331] Combine create + chain into tabbed page with Add Plot shortcut#333realproject7 merged 3 commits intomainfrom
Conversation
- Unified /create page with [New] and [Add Plot] tabs - New tab: full create storyline form (unchanged behavior) - Add Plot tab: chain plot form with storyline selector - ?tab=chain and ?storyline=<id> query params auto-select and prefill - /chain now redirects to /create?tab=chain - Removed "chain" link from NavBar - Added AddPlotButton client component on story detail page, visible only to the connected writer, links to /create?tab=chain Fixes #331 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
project7-interns
left a comment
There was a problem hiding this comment.
T2b REQUEST CHANGES
Blocking: src/app/chain/page.tsx discards query params on redirect. The comment says "Forward any query params" but void searchParams explicitly drops them, so /chain?storyline=123 → /create?tab=chain (loses storyline=123).
Fix: await searchParams and forward them:
export default async function ChainRedirect({
searchParams,
}: {
searchParams: Promise<Record<string, string>>;
}) {
const params = await searchParams;
const qs = new URLSearchParams(params).toString();
redirect("/create?tab=chain" + (qs ? "&" + qs : ""));
}Everything else looks correct:
- Tabbed page with query param support ✅
- AddPlotButton writer-only check ✅
- NavBar chain link removed ✅
- Published states scoped per tab ✅
- No state leakage between tabs ✅
project7-interns
left a comment
There was a problem hiding this comment.
Verdict: REQUEST CHANGES
Summary
The tabbed /create consolidation is close, but the backward-compat redirect for /chain drops incoming query params, which breaks deep links into the Add Plot flow.
Findings
- [high]
/chaindoes not forwardstoryline(or any other) query params despite the comment saying it does.- File:
src/app/chain/page.tsx:8 - Suggestion: Preserve the incoming search params when redirecting, e.g. redirect
/chain?storyline=123to/create?tab=chain&storyline=123. As written, old links lose the preselected storyline and no longer satisfy the deep-link/prefill behavior.
- File:
Decision
Request changes. The redirect needs to preserve query params so the old chain entry points continue to land on the correct prefilled Add Plot state.
Await searchParams and forward all params (e.g. storyline=123) to /create?tab=chain&storyline=123 so old deep links still work. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
project7-interns
left a comment
There was a problem hiding this comment.
T2b APPROVE
Blocker fixed: /chain redirect now awaits searchParams and forwards all query params (excluding tab). /chain?storyline=123 → /create?tab=chain&storyline=123 ✅
project7-interns
left a comment
There was a problem hiding this comment.
Verdict: APPROVE
Summary
The follow-up fixes the backward-compat redirect so old /chain deep links preserve their query params when landing on the unified /create flow. The combined create/chain experience now matches issue #331.
Findings
- [low] The prior blocker is resolved:
/chainnow forwards incoming search params into/create?tab=chain..., so oldstorylinedeep links still prefill the Add Plot tab correctly.- File:
src/app/chain/page.tsx:8 - Suggestion: None.
- File:
Decision
Approve. The tabbed /create flow, writer-only story shortcut, nav cleanup, and redirect behavior now align with the requested scope, and local npm run build plus npm run typecheck both pass.
The initial useState already reads from the query param, so the effect was redundant. Removes the set-state-in-effect lint violation. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
project7-interns
left a comment
There was a problem hiding this comment.
Verdict: APPROVE
Summary
The follow-up removes the lint-blocking state update effect without changing the approved behavior. The unified /create flow and /chain redirect remain correct on the current head.
Findings
- [low] The storyline prefill now relies on initial query-param state instead of an effect, which avoids the
react-hooks/set-state-in-effectlint violation while preserving the expected deep-link behavior.- File:
src/app/create/page.tsx:99 - Suggestion: None.
- File:
Decision
Approve. The current PR head remains within issue #331 scope, and local npm run build plus npm run typecheck both pass.
Summary
[New]and[Add Plot]tabs on a unified page?tab=chainselects Add Plot tab;?storyline=<id>prefills the storyline selector/chainpage now redirects to/create?tab=chain/create?tab=chain&storyline={id}5 files changed. Both forms preserve existing behavior.
Fixes #331
Test plan
npm run buildpassesnpm run typecheckpasses/createshows New tab by default with storyline form/create?tab=chainshows Add Plot tab with chain form/create?tab=chain&storyline=1prefills storyline selector/chainredirects to/create?tab=chain